package com.wish.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wish.dto.TsfContractDto;
import com.wish.entity.TSfContract;
import com.wish.mapper.TSfContractMapper;
import com.wish.service.ITSfContractService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 五组
 * @since 2021-03-29
 */
@Service
public class TSfContractServiceImpl extends ServiceImpl<TSfContractMapper, TSfContract> implements ITSfContractService {

    @Autowired
    TSfContractMapper contractMapper;

    @Override
    public PageInfo<TSfContract> getlist(TsfContractDto tsfContractDto) {
        System.out.println(tsfContractDto+"=-=-=-=-=-=-");
        PageHelper.startPage(tsfContractDto.getPageNum(),tsfContractDto.getPageSize());
        List<TSfContract> list = contractMapper.getlist(tsfContractDto);
        return new PageInfo<>(list);
    }

    @Override
    public PageInfo<TSfContract> getlists(TsfContractDto tsfContractDto) {
        PageHelper.startPage(tsfContractDto.getPageNum(),tsfContractDto.getPageSize());
        List<TSfContract> list = contractMapper.getlists(tsfContractDto);
        return new PageInfo<>(list);
    }

    @Override
    public PageInfo<TSfContract> jie(TsfContractDto tsfContractDto) {
        PageHelper.startPage(tsfContractDto.getPageNum(),tsfContractDto.getPageSize());
        List<TSfContract> list =contractMapper.jie(tsfContractDto);

        for (TSfContract a:list
             ) {
            System.out.print(a);
        }
        return new PageInfo<>(list);
    }

    @Override
    public TSfContract getOnee(Integer id) {
        return contractMapper.getOnee(id);
    }

}
